﻿<%@page import="java.util.*" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%
	if(session.getAttribute("hotelId") == null || 
		session.getAttribute("userid") == null){
		response.sendRedirect("/index.jsp");
		return;
	}else if(session.getAttribute("workArea") == null ||
		session.getAttribute("counter") == null){
		response.sendRedirect("/choseworkarea.jsp");
		return;	
	}
	String Code = (String)session.getAttribute("LanguageCode");
	String SubCode = (String)session.getAttribute("LanguageSubcode");
    Locale locale = new Locale(Code, SubCode);
	ResourceBundle resource = ResourceBundle.getBundle("resource", locale);
%>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<title>Front | Eem tech soft</title>
<link href="css/main.css" rel="stylesheet" />

<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/jquery-ui-1.9.1.custom.min.js"></script>
<script src="js/sharedData.js"></script>
<script src="js/jquery.event.drag-2.2.js"></script>
<script src="js/jquery.event.drag.live-2.2.js"></script>
<script src="js/jquery.event.drop-2.2.js"></script>
<script src="js/jquery.event.drop.live-2.2.js"></script>
<script src="js/components/language/lang.js"></script>
<script src="js/simpleservice.js"></script>

<link href="css/custom/loading.css" rel="stylesheet" />
<link href="css/components/front.css" rel="stylesheet" />
<link href="css/custom/jquery-ui-1.9.1.custom.min.css" rel="stylesheet" />
<script src="js/loading.js"></script>
<script src="js/components/selectDropDown.js" defer></script>
<script src="js/components/task/task.js"></script>
<script src="js/components/timespan/timespan.js"></script>

<link rel="stylesheet" href="css/Adminconsole/menu/jquery-ui.css"/>
<link rel="stylesheet" href="css/Adminconsole/menu/menu.css" />
<script src="js/adminconsole/menu/menu.js"></script>

<script src="/js/jquery.paginate.js"></script>
<script src="/js/components/roomManagementList/pager.js"></script>
<script src="/js/components/EditReservation/splitreservation.js"></script>
<script src="/js/components/detailInformation/auditTrail.js"></script>
<script src="/js/components/EditReservation/moveReservation.js"></script>
<script src="/js/components/EditReservation/EditReservManageGuests.js"></script>
<script src="/js/components/EditReservation/editreservation.js"></script>
<script src="/js/FrontFunction.js"></script>
<script src="/js/sizeof.js"></script>
<script src="js/components/EditReservation/editReservationTable.js" ></script>
<script src="js/components/Payment/Payment.js" ></script>
<script src="js/components/EditReservation/EditReservationManageResData.js"></script>
<script src="js/components/Payment/suggest.js"></script>


<script>
	$(document).ready(function(){
	$("body div:last").remove();
	});
</script>

<script>

$(function($){	
	loadSharedData(function(){
		setTimeout(function(){
			selectedDate = getDate();
			ShortDay = ["<% out.print(resource.getString("Calendar.ShortDay.Sun")); %>",
				 "<% out.print(resource.getString("Calendar.ShortDay.Mon")); %>",
				 "<% out.print(resource.getString("Calendar.ShortDay.Tue")); %>",
				 "<% out.print(resource.getString("Calendar.ShortDay.Wed")); %>",
				 "<% out.print(resource.getString("Calendar.ShortDay.Thu")); %>",
				 "<% out.print(resource.getString("Calendar.ShortDay.Fri")); %>",
				 "<% out.print(resource.getString("Calendar.ShortDay.Sat")); %>"];
			
			switch(selectedTimeSpan)
			{
				case "1": cerltimespan($("#buttononeDay").get(0),loadEtcElement,false); break;
				case "3": cerltimespan($("#buttonthreeDays").get(0),loadEtcElement,false); break;
				case "7": cerltimespan($("#buttonweek").get(0),loadEtcElement,false); break;
				case "15": cerltimespan($("#buttonfifteenDays").get(0),loadEtcElement,false); break;
				case "30": cerltimespan($("#buttonmonth").get(0),loadEtcElement,false); break;
				default : cerltimespan($("#buttonthreeDays").get(0),loadEtcElement,false); break;
			}
		},50);
	});
	hotelId = <%=session.getAttribute("hotelId") %>;
	componentLoading($(".setright table"));
});

function loadEtcElement(){
	closeComponentLoading($(".setright table"));
	updateFrontTaskList(true);
	updateFrontPaymentList(true);
	delayLoad();
}

$(window).load(function() {debugger;
	updateLastStay(true);
	$(document).scroll(function(){
		if($(".setright table tr:first").offset().top < $(document).scrollTop()){
			if($("#clonedateforscroll").size()==0){
				var cloneobj = $("<table id='clonedateforscroll'></table>").append($(".setright table tr:first").clone());
				$('body').append(cloneobj);
				cloneobj.css("position","fixed");
				cloneobj.css("left",($(".setright table tr:first").offset().left + 1));
				cloneobj.css("width",($(".setright table tr:first").width() + 1));
				cloneobj.css("border-bottom","1px solid #000");
				cloneobj.find("td").each(function(n){$(this).width($($(".setright table tr:first td").get(n)).width());})
			}
		}
		else
			if($("#clonedateforscroll").size()>0)$("#clonedateforscroll").remove();
	})
}); 
</script>

</head>
<body> 
<%
if(session.getAttribute("LanguageSubcode") != null || session.getAttribute("LanguageCode") != null){
%>
<jsp:include page="language.jsp" flush="true" />

<div id="test"> </div>
<div id="left">
	<img src="images/logo.png" style="margin-bottom:10px; margin-left:50px;"/>
	<jsp:include page="components/calendar/calendar.jsp" flush="true" />
	<jsp:include page="components/roomManagementList/roomManagementList.jsp" flush="true"/>
	<jsp:include page="components/detailedInformation/detailInformation.jsp" flush="true"/>
</div>
<div id="blockedAndTask" style="float:left;position:absolute;margin-left:166px;">
	<jsp:include page="components/mainmenu/mainmanu.jsp" flush="true"/>
	<div id="tablayout3" style="float:left;"><jsp:include page="components/tappage/tappage.jsp" flush="true"/></div>
	<div id="tablayout" >
		<jsp:include page="components/smartSearch/smartSearch.jsp" flush="true"/><br/>
	</div>
	<div style="clear:both;"></div>
	<div for="front">
		<div id="menulist">
			<jsp:include page="components/timespan/timespanmenu.jsp" flush="true"/>
		</div>
		<div style="position:absoulte;float:right;">
			<jsp:include page="components/task/tasklist.jsp" flush="true"/>
			<jsp:include page="components/hoardingList/hoardingList.jsp" flush="true"/>
			<jsp:include page="components/task/popupaddtask.jsp" flush="true"/>
		</div>
		<div style="position:absolute;float:left;margin:0 202px 0 0">
			<div id="blocked" class="inner_position_left">
				<jsp:include page="components/blocked/blocked.jsp" flush="true"/>
			</div>
		</div>
	</div>
	<div forload="editreserved"></div>
	<div id="RoomManagementBlock"><jsp:include page="components/newpage/roomManagementList/newpageRoomManagementList.jsp" flush="true"/></div>
</div>
</div>


<jsp:include page="components/rightclickmenu/rightclickmenu.jsp" flush="true"/>
<jsp:include page="components/rightclickmenu/rightclickcleaningmenu.jsp" flush="true"/>

<div name="dynamic"></div>
<jsp:include page="/components/EditReserved/datetimepicker.jsp" flush="true"/>
<jsp:include page="components/blocked/popup/splitRoom.jsp" flush="true"/>


<!-----Yes/No---->
<div id="EmptyDialog" style="display:none; padding:5px 0 0 10px;">
</div>
<!-----Message--->
<div id="EmptyMessageDialog" style="display:none; padding:5px 0 0 10px;">
</div>
<!----Blank---->
<div id="BlankDialog" style="display:none; padding:5px 0 0 10px;">
</div>

<%
}else{
	response.sendRedirect("index.jsp");
}
%>
</body>
</html>
